<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form id="form_usuario" action="<?php echo url_for('usuario/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_usuario='.$form->getObject()->getIdUsuario() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="id_usuario" value="<?php echo $form->getObject()->getIdUsuario() ?>" />
<?php endif; ?>
	<?php echo $form->renderHiddenFields() ?>
  <table class="form">
    <tbody>
      <tr><th colspan="2" class="title">Dados usuario</th></tr>	
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['no_usuario']->renderLabel() ?></th>
        <td>
          <?php echo $form['no_usuario'] ?>
          <?php echo form_error('no_usuario'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['sobrenome']->renderLabel() ?></th>
        <td>
          <?php echo $form['sobrenome'] ?>
          <?php echo form_error('sobrenome'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['email']->renderLabel() ?></th>
        <td>
          <?php echo $form['email'] ?>
          <?php echo form_error('email'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['ddd_tel_celular']->renderLabel() ?></th>
        <td>
          <?php echo $form['ddd_tel_celular'] ?>
          <?php echo form_error('ddd_tel_celular'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['tel_celular']->renderLabel() ?></th>
        <td>
          <?php echo $form['tel_celular'] ?>
          <?php echo form_error('tel_celular'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['sexo']->renderLabel() ?></th>
        <td>
          <?php echo $form['sexo'] ?>
          <?php echo form_error('sexo'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['dt_nascimento']->renderLabel() ?></th>
        <td>
          <?php echo $form['dt_nascimento'] ?>
          <?php echo form_error('dt_nascimento'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['groups_list']->renderLabel() ?></th>
        <td>
          <?php echo $form['groups_list'] ?>
          <?php echo form_error('groups_list'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['permissions_list']->renderLabel() ?></th>
        <td>
          <?php echo $form['permissions_list'] ?>
          <?php echo form_error('permissions_list'); ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>

<?php 
	comandos_form(
		link_to(
			':: Voltar ::',
			'usuario/filter',
			array('class' => 'botao')
		),
		button_to_function(
			':: Salvar ::',
			"$('#form_usuario').submit()",
			array('class' => 'botao')
		)
	);
?>